/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import componenten.Database;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import model.*;

/**
 *
 * @author misja
 */
public class ToernooiBeheren extends javax.swing.JFrame {

    private Toernooi clsToernooi;

    /**
     * Creates new form ToernooiBeheren
     */
    public ToernooiBeheren(String argDatum, String argNaam) {
        initComponents();

        Toernooi toernooi = new Toernooi(argNaam, argDatum);
        this.clsToernooi = toernooi;

        this.txtNaam.setText(this.clsToernooi.getNaam());
        this.txtDatum.setText(this.clsToernooi.getDatum());
        this.txtTijd.setText(this.clsToernooi.getTijd());
        this.txtInleggeld.setText("" + this.clsToernooi.getInleggeld());
        this.txtMinAantalSpelers.setText("" + this.clsToernooi.getMinAantalSpelers());
        this.txtHuisnummer.setText(this.clsToernooi.getHuisnummer());
        this.txtPostcode.setText(this.clsToernooi.getPostcode());

        txtNaam.setEditable(false);
        txtDatum.setEditable(false);
        txtTijd.setEditable(false);
        txtInleggeld.setEditable(false);
        txtMinAantalSpelers.setEditable(false);
        txtHuisnummer.setEditable(false);
        txtPostcode.setEditable(false);

        this.vulTabelSpeler();
        this.vulTabelTafelRonde();

    }

    private ToernooiBeheren() {
    }

    private void vulTabelSpeler() {

        String[] kolommen = {"Naam", "Rating"};
        DefaultTableModel model = new DefaultTableModel(kolommen, 0);

        try {
            String sql = "SELECT * FROM fullhouse.speler WHERE toernooi_datum = '" + this.clsToernooi.getDatum() + "'" + " AND toernooi_naam = '" + this.clsToernooi.getNaam() + "'";
            System.out.println(sql);
            ResultSet resultaat = Database.executeSelectQuery(sql);

            while (resultaat.next()) {
                String id = resultaat.getString("lid_id");
                String datum = resultaat.getString("toernooi_datum");
                String naam = resultaat.getString("toernooi_naam");

                Speler tabelVulling = new Speler(id, datum, naam);
                model.addRow(tabelVulling.getInformatie());
            }
        } catch (SQLException e) {
            System.out.println(e);

        }

        tblSpeler.setModel(model);
    }

    private void vulTabelTafelRonde() {
        //nog toedoen allen de laatste ronde laten zien in de query
        String[] kolommen = {"R", "T", "W"};
        DefaultTableModel model = new DefaultTableModel(kolommen, 0);

        try {
            String sql = "SELECT * FROM fullhouse.tafelronde WHERE toernooi_datum = '" + this.clsToernooi.getDatum() + "'" + " AND toernooi_naam = '" + this.clsToernooi.getNaam() + "' AND tafelronde_rondenummer in (select max(tafelronde_rondenummer) from tafelronde where toernooi_naam = '" + this.clsToernooi.getNaam() + "' and toernooi_datum = '" + this.clsToernooi.getDatum() + "')  ";
            ResultSet resultaat = Database.executeSelectQuery(sql);

            while (resultaat.next()) {
                String tafel = resultaat.getString("tafelronde_tafelnummer");
                String ronde = resultaat.getString("tafelronde_rondenummer");
                String datum = resultaat.getString("toernooi_datum");
                String naam = resultaat.getString("toernooi_naam");

                TafelRonde tabelVulling = new TafelRonde(tafel, ronde, datum, naam);
                model.addRow(tabelVulling.getInformatie());
            }
        } catch (SQLException e) {
            System.out.println(e);

        }

        tblTafelRonde.setModel(model);
    }

    private void vulTabelTafelRondeSpeler(String argTafelnummer, String argRondenummer) {
        //nog toedoen allen de laatste ronde laten zien in de query
        String[] kolommen = {"R", "T", "Naam", "id"};
        DefaultTableModel model = new DefaultTableModel(kolommen, 0);

        try {
            String sql = "SELECT * FROM fullhouse.tafelronde_speler"
                    + " WHERE toernooi_datum = '" + this.clsToernooi.getDatum() + "'"
                    + " AND toernooi_naam = '" + this.clsToernooi.getNaam() + "'"
                    + " AND tafelronde_tafelnummer = " + argTafelnummer
                    + " AND tafelronde_rondenummer = " + argRondenummer;
            System.out.println(sql);
            ResultSet resultaat = Database.executeSelectQuery(sql);

            while (resultaat.next()) {
                String tafel = resultaat.getString("tafelronde_tafelnummer");
                String ronde = resultaat.getString("tafelronde_rondenummer");
                String datum = resultaat.getString("toernooi_datum");
                String naam = resultaat.getString("toernooi_naam");
                String speler = resultaat.getString("speler_id");

                TafelRondeSpeler tabelVulling = new TafelRondeSpeler(tafel, ronde, datum, naam, speler);
                model.addRow(tabelVulling.getInformatie());
            }
        } catch (SQLException e) {
            System.out.println(e);

        }

        tblTafelRondeSpeler.setModel(model);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        txtDatum = new javax.swing.JTextField();
        lblDeelnemer = new javax.swing.JLabel();
        txtHuisnummer = new javax.swing.JTextField();
        txtPostcode = new javax.swing.JTextField();
        txtNaam = new javax.swing.JTextField();
        txtMinAantalSpelers = new javax.swing.JTextField();
        lblInleg = new javax.swing.JLabel();
        lblNaam = new javax.swing.JLabel();
        lblDatum = new javax.swing.JLabel();
        lblTijd = new javax.swing.JLabel();
        lblHuisnummer = new javax.swing.JLabel();
        lblPostcode = new javax.swing.JLabel();
        txtInleggeld = new javax.swing.JTextField();
        txtTijd = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        tblSpeler = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        tblTafelRondeSpeler = new javax.swing.JTable();
        btnKnockOut = new javax.swing.JButton();
        btnRondeStarten = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        tblTafelRonde = new javax.swing.JTable();
        btnSpelersZien = new javax.swing.JButton();
        btnWinnaar = new javax.swing.JButton();
        Cancel = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("toernooi beheren");

        txtDatum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtDatumActionPerformed(evt);
            }
        });

        lblDeelnemer.setText("min deelnemers");

        txtHuisnummer.setFocusable(false);

        txtPostcode.setFocusable(false);

        lblInleg.setText("Inleg");

        lblNaam.setText("Naam");

        lblDatum.setText("Datum");

        lblTijd.setText("Tijd");

        lblHuisnummer.setText("Huisnummer");

        lblPostcode.setText("postcode");

        tblSpeler.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tblSpeler);

        tblTafelRondeSpeler.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(tblTafelRondeSpeler);

        btnKnockOut.setText("Knockout");
        btnKnockOut.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnKnockOutActionPerformed(evt);
            }
        });

        btnRondeStarten.setText("Ronde starten");
        btnRondeStarten.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRondeStartenActionPerformed(evt);
            }
        });

        tblTafelRonde.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane4.setViewportView(tblTafelRonde);

        btnSpelersZien.setText("Spelers per tafel");
        btnSpelersZien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSpelersZienActionPerformed(evt);
            }
        });

        btnWinnaar.setText("Winnaar");
        btnWinnaar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnWinnaarActionPerformed(evt);
            }
        });

        Cancel.setText("cancel");
        Cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(6, 6, 6)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnSpelersZien, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                            .addComponent(btnRondeStarten, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnKnockOut, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnWinnaar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(Cancel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(lblNaam)
                                .addGap(91, 91, 91))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblDatum, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblTijd, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblInleg, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblDeelnemer)
                                    .addComponent(lblPostcode, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblHuisnummer, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(18, 18, 18)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(txtNaam, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtDatum, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtTijd, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtInleggeld, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtMinAantalSpelers, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPostcode, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtHuisnummer, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(15, 15, 15))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtNaam, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblNaam))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtDatum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDatum))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtTijd, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblTijd))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtInleggeld, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblInleg)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(140, 140, 140)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblDeelnemer)
                            .addComponent(txtMinAantalSpelers, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblPostcode)
                            .addComponent(txtPostcode, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblHuisnummer)
                            .addComponent(txtHuisnummer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnRondeStarten)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnSpelersZien)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnKnockOut)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btnWinnaar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(Cancel))
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void txtDatumActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtDatumActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_txtDatumActionPerformed

    private void btnKnockOutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKnockOutActionPerformed
        int geselecteerdeRij = tblTafelRondeSpeler.getSelectedRow();
        if (geselecteerdeRij == -1) {
            JOptionPane.showMessageDialog(null, "Selecteer eerst een speler voordat u hem winnaar kunt maken");
        } else {
            String tafel = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 1);
            String ronde = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 0);
            String speler = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 3);
            TafelRondeSpeler tf = new TafelRondeSpeler(tafel, ronde, this.clsToernooi.getDatum(), this.clsToernooi.getNaam(), speler);

            tf.verwijderen();
            this.vulTabelTafelRondeSpeler(tafel, ronde);
        }
    }//GEN-LAST:event_btnKnockOutActionPerformed

    private void btnSpelersZienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSpelersZienActionPerformed
        int geselecteerdeRij = tblTafelRonde.getSelectedRow();
        if (geselecteerdeRij == -1) {
            JOptionPane.showMessageDialog(null, "Selecteer eerst een tafel voordat u kunt Beheren");
        } else {
            String tafel = (String) tblTafelRonde.getModel().getValueAt(geselecteerdeRij, 1);
            String ronde = (String) tblTafelRonde.getModel().getValueAt(geselecteerdeRij, 0);

            this.vulTabelTafelRondeSpeler(tafel, ronde);
        }
    }//GEN-LAST:event_btnSpelersZienActionPerformed

    private void btnRondeStartenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRondeStartenActionPerformed
        //kijken naar hoogste ronde in db ronde effkes regelen dat als er een niuew ronde wordt gestart mot hij allen van de winnaars pakke;s
        TafelRonde tf = new TafelRonde();
        System.out.println(tf.haalLaatsteRondeNummerOp("2012-12-12", "testToernooi") + "laatse RONDE!!!!!!");     
        Tafelverdeling t = new Tafelverdeling("testToernooi", "2012-12-12", tf.haalLaatsteRondeNummerOp("2012-12-12", "testToernooi"));
        t.naarDatabase();

        this.vulTabelTafelRonde();
    }//GEN-LAST:event_btnRondeStartenActionPerformed

    private void btnWinnaarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnWinnaarActionPerformed
        int geselecteerdeRij = tblTafelRondeSpeler.getSelectedRow();
        if (geselecteerdeRij == -1) {
            JOptionPane.showMessageDialog(null, "Selecteer eerst een speler voordat u hem winnaar kunt maken");
        } else {
            String tafel = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 1);
            String ronde = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 0);
            String winnaar = (String) tblTafelRondeSpeler.getModel().getValueAt(geselecteerdeRij, 3);

            TafelRonde tf = new TafelRonde(tafel, ronde, this.clsToernooi.getDatum(), this.clsToernooi.getNaam());
            tf.setWinnaar(Integer.parseInt(winnaar));
            tf.bijwerken(tafel, ronde, this.clsToernooi.getDatum(), this.clsToernooi.getNaam());

            this.vulTabelTafelRonde();
        }
    }//GEN-LAST:event_btnWinnaarActionPerformed

    private void CancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelActionPerformed
        this.dispose();
    }//GEN-LAST:event_CancelActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(ToernooiBeheren.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(ToernooiBeheren.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(ToernooiBeheren.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(ToernooiBeheren.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ToernooiBeheren().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton Cancel;
    private javax.swing.JButton btnKnockOut;
    private javax.swing.JButton btnRondeStarten;
    private javax.swing.JButton btnSpelersZien;
    private javax.swing.JButton btnWinnaar;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JLabel lblDatum;
    private javax.swing.JLabel lblDeelnemer;
    private javax.swing.JLabel lblHuisnummer;
    private javax.swing.JLabel lblInleg;
    private javax.swing.JLabel lblNaam;
    private javax.swing.JLabel lblPostcode;
    private javax.swing.JLabel lblTijd;
    private javax.swing.JTable tblSpeler;
    private javax.swing.JTable tblTafelRonde;
    private javax.swing.JTable tblTafelRondeSpeler;
    private javax.swing.JTextField txtDatum;
    private javax.swing.JTextField txtHuisnummer;
    private javax.swing.JTextField txtInleggeld;
    private javax.swing.JTextField txtMinAantalSpelers;
    private javax.swing.JTextField txtNaam;
    private javax.swing.JTextField txtPostcode;
    private javax.swing.JTextField txtTijd;
    // End of variables declaration//GEN-END:variables
}
